{% load static thumbnail %}

<li>
    {% thumbnail message.sender.picture "x45" as im %}
        <img class="picture" src="{{ im.url }}" alt="用户头像">
    {% empty %}
        <img class="picture" src="{% static 'images/user.png' %}" height="45px" alt="没有头像"/>
    {% endthumbnail %}
    <div>
        <b>
            <a href="{% url 'users:detail' message.sender.username %}">{{ message.sender.get_profile_name }}</a>
        </b>
        <small> - {{ message.created_at|date:'Y-m-d H:i:s' }}</small>
        <br>
        {{ message.message }}
    </div>
</li>
